import Vue from 'vue';
import VueRouter from 'vue-router';
import Home from '@/pages/Home.vue';
import Detail from '@/pages/Detail.vue';

Vue.use(VueRouter);
export default new VueRouter({
    mode: 'hash',
    routes: [{
        path: '/',
        redirect: '/home'
    }, {
        path: '/home',
        name: 'home',
        component: Home
    }, {
        path: '/detail/:id',
        name: 'detail',
        component: Detail
    }, {
        path: '/category',
        name: 'category',
        component: () => import( /* webpackChunkName: "other" */ '@/pages/Category.vue')
    }, {
        path: '/person',
        name: 'person',
        component: () => import( /* webpackChunkName: "other" */ '@/pages/Person.vue')
    }, {
        path: '/cart',
        name: 'cart',
        component: () => import( /* webpackChunkName: "other" */ '@/pages/Cart.vue')
    },
    {
        path: '/worth',
        name: 'worth',
        component: () => import( /* webpackChunkName: "other" */ '@/pages/Worth.vue'),
        children: [
            {
                path: '/worth/classify',
                name: 'classify',
                component: () => import(/* webpackChunkName: "other" */ '@/pages/Worths/classify.vue'),
            }
        ],
        children: [
            {
                path: '/worth/falls',
                name: 'falls',
                component: () => import(/* webpackChunkName: "other" */ '@/pages/Worths/falls.vue'),
            }
        ],
    },
    {
        path: '/search',
        name: 'search',
        component: () => import( /* webpackChunkName: "other" */ '@/pages/Search.vue')
    },
    {
        path: '/address',
        name: 'address',
        component: () => import( /* webpackChunkName: "other" */ '@/pages/Address.vue')
    },
        , {
        path: '*',
        redirect: '/home'
    }]
});